// ==UserScript==
// @name        网页复制限制解除脚本
// @namespace   https://greasyfork.org/users/14059
// @description description
// @include     http://www.360doc.com/content/*
// @include     http://www.360doc.com/document/*
// @include     https://www.2dfan.com/*
// @require     http://cdn.staticfile.org/jquery/3.1.1/jquery.min.js
// @author      setycyas
// @version     0.01
// @grant       None
// @run-at      document-end
// @license     MIT
// ==/UserScript==

(function(){
  /* 脚本正式开始 */

  'use strict';
  console.log("破解防复制脚本开始运行!");
  var $jq=$.noConflict();

  /****************************************
  ######## 油猴API以及常用API示例 #########
  ****************************************/

  //注册菜单api
  //GM_registerMenuCommand('菜单名',functionName);

  //数据读写api
  //GM_setValue(key,value);
  //GM_getValue(key);

  //跨域http请求api
  //GM_xmlhttpRequest({method:'GET',url:'http://x',headers: {},timeout:millSec,
  //  ontimeout: function(response){},
  //  onload: function (response){console.log(response.finalUrl,response.responseText);} 

  //添加新网页元素
  //$jq("<div>new div</div>").appendTo($('body'));
  //添加css
  //GM_addStyle("#hd{display:none !important}");

  /****************************************
  ######## version time&version ###########
  ######## 脚本正式开始 ###################
  ****************************************/

  /* Global Variable */


  /* Functions */


  /* Main Script */
  //360doc
  document.body.oncopy = null; //去掉当前设置的复制监听
  document.body.__defineSetter__("oncopy",function(){}); //禁止修改复制监听
  //2Dfan
  var divs = document.getElementsByClassName("control-group topic-content");
  if(divs.length > 0){
    var div2DFan = divs[0];
    div2DFan.oncopy = null;
    div2DFan.__defineSetter__("oncopy",function(){});
    div2DFan.__defineSetter__("oncut",function(){});
  }

/* 脚本结束 */
})();
